package cn.techjc.service.impl;

import cn.techjc.dao.UserTestDao;
import cn.techjc.domain.UserTest;
import cn.techjc.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chenyu on 2016/8/11.
 */
@Service
public class TestServiceImpl implements TestService {

    @Autowired
    UserTestDao userTestDao;

    @Autowired
    RedisTemplate redisTemplate;

    @Override
    public List<UserTest> getUsers() {
        return userTestDao.select();
    }

    @Override
    public String getUsersNumByRedis() {
        redisTemplate.opsForValue().set("users","101");
        return (String) redisTemplate.opsForValue().get("users");
    }
}
